package _14作业.t2;

import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
import java.util.Set;

public class Demo4 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.nextLine();
        Map<Character,Integer> map = new HashMap<>();
        for (int i = 0; i < s.length() ; i++) {
            char c = s.charAt(i);
            if (map.containsKey(c)){
                Integer value = map.get(c);
                map.put(c,value+1);
            }else {
                map.put(c,1);
            }
        }

        Set<Character> characters = map.keySet();
        for (Character character : characters) {
            System.out.printf(character+"("+map.get(character)+")");
        }
    }
}
